package com.nettyspringbootclient.demo.controller.client;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.pojo.User;
import com.nettyspringbootclient.demo.controller.client.handler.RpcClientProxy;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/nettyClient")
public class Nettycontroller {
    @RequestMapping("/getData")
    public void getData(){
        IUserService userService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
        User user = userService.getById(1);
        System.out.println(user);
    }
}
